package com.gopay.common.user.dao.impl;

import java.io.Serializable;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseReadDAOImpl;
import com.gopay.common.domain.user.identify.RcAcctPayLimit;
import com.gopay.common.user.dao.RcAcctPayLimitDao;



/**
 * 
 * @RcAcctPayLimitDaoImpl.java
 * @author zhaojunting
 * @2016年5月17日 下午1:08:47  www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("rcAcctPayLimitDao")
public class RcAcctPayLimitDaoImpl extends BaseReadDAOImpl<RcAcctPayLimit, Serializable> implements RcAcctPayLimitDao {

    
    @Override
    public RcAcctPayLimit findByAcctType(String acctType) {
        DetachedCriteria criteria = DetachedCriteria.forClass(RcAcctPayLimit.class);
        criteria.add(Restrictions.eq("acctType", acctType));
        
        List<RcAcctPayLimit> list = findByCriteria(criteria);
        
        if(list == null || list.size() == 0){
            return null;
        }else{
            return list.get(0);
        }
    }

}
